package com.atguigu.core.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Swagger3Config {
    @Bean
    public GroupedOpenApi PayApi
            () {
        return GroupedOpenApi.builder()
                .group("支付模块")
                .pathsToMatch("/pay/**")
                .build();
    }

    @Bean
    public GroupedOpenApi OtherApi
            () {
        return GroupedOpenApi.builder()
                .group("其他模块")
                .pathsToMatch("/other/**", "/others")
                .build();
    }








    @Bean
    public OpenAPI docsOpenApi() {
        return new OpenAPI()
                .info(new Info()
                        .title("cloud2024")
                        .version("1.0")
                        .description("通用涉及rest"))
                    .externalDocs(new ExternalDocumentation()

                                .url("https://yiyan.baidu.com/"));
    }

}
